var path = require('path');
var fs = require('fs');
function getEntry(path_,prefix) {
    var jsPath = path.resolve(path_);
    var dirs = fs.readdirSync(jsPath);
    var matchs = [], files = {};
    dirs.forEach(function (item) {
        var path__ = path.resolve(path_, item)
        matchs = item.match(/(.+)\.js$/);
        var stat = fs.statSync(path__);
        if (stat.isFile()) {
            files[(prefix ? (prefix +'/'): '')+''+matchs[1]] = path.resolve(path_, item);
        } else if (stat.isDirectory()) {
            Object.assign(files, getEntry(path.resolve(path_, item),item));
        }
    });
    return files;
}
console.log(getEntry('./examples/default/js',''));
